package com.aitech.hardwareconctrl;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    public Button faceButton;
    public Button armsetButton;
    public Button aitecharmButton;
    public TextView logInfor;
    public String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        logInfor = findViewById(R.id.log);
        initview();
//        SomeUtils.initSerialPort();
//        SomeUtils.readSerial();
//        if (SomeUtils.opensuss()) {
//            logInfor.setText("/dev/ttyAMA3 串口打开成功");
//        } else {
//            logInfor.setText("/dev/ttyAMA3 串口打开失败");
//        }
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id == R.id.face) {
            //  SomeUtils.speak();
            startActivity(new Intent(MainActivity.this, FaceActivity.class));
        }
        if (id == R.id.arm) {
            //SomeUtils.stopspeak();
            startActivity(new Intent(MainActivity.this, ArmActivity.class));
        }
        if (id == R.id.aitecharm) {
            //SomeUtils.stopspeak();
            startActivity(new Intent(MainActivity.this, ArmAItechActivity.class));
        }
    }


    public void initview() {

        faceButton = (Button) findViewById(R.id.face);
        armsetButton = (Button) findViewById(R.id.arm);
        aitecharmButton = (Button) findViewById(R.id.aitecharm);

        faceButton.setOnClickListener(this);
        armsetButton.setOnClickListener(this);
        aitecharmButton.setOnClickListener(this);


    }

    @Override
    public void onPointerCaptureChanged(boolean hasCapture) {


    }
}
